home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr45 / mdidmo.zip / MDIDRAW1.FRM < prev    next >
Text File  |  1994-04-29  |  4KB  |  176 lines

  1. VERSION 2.00
  2. Begin Form frmChild 
  3.    Caption         =   "Form2"
  4.    ClientHeight    =   3225
  5.    ClientLeft      =   1620
  6.    ClientTop       =   2865
  7.    ClientWidth     =   6885
  8.    FontBold        =   -1  'True
  9.    FontItalic      =   -1  'True
  10.    FontName        =   "MS Sans Serif"
  11.    FontSize        =   30
  12.    FontStrikethru  =   0   'False
  13.    FontUnderline   =   0   'False
  14.    Height          =   3915
  15.    Left            =   1560
  16.    LinkTopic       =   "Form2"
  17.    MDIChild        =   -1  'True
  18.    ScaleHeight     =   3225
  19.    ScaleWidth      =   6885
  20.    Top             =   2235
  21.    Visible         =   0   'False
  22.    Width           =   7005
  23.    Begin CommandButton Command1 
  24.       Caption         =   "&Hide Me!"
  25.       Height          =   345
  26.       Left            =   180
  27.       TabIndex        =   0
  28.       Top             =   180
  29.       Width           =   1755
  30.    End
  31.    Begin Menu mMain 
  32.       Caption         =   "&Child"
  33.       Index           =   0
  34.       Begin Menu mForm 
  35.          Caption         =   "&Hide "
  36.          Index           =   0
  37.          Shortcut        =   ^H
  38.       End
  39.       Begin Menu mForm 
  40.          Caption         =   "&Unload "
  41.          Index           =   1
  42.          Shortcut        =   ^U
  43.       End
  44.       Begin Menu mForm 
  45.          Caption         =   "-"
  46.          Index           =   2
  47.       End
  48.       Begin Menu mForm 
  49.          Caption         =   "&Show All"
  50.          Index           =   3
  51.          Shortcut        =   ^S
  52.       End
  53.       Begin Menu mForm 
  54.          Caption         =   "-"
  55.          Index           =   4
  56.       End
  57.       Begin Menu mForm 
  58.          Caption         =   "E&xit"
  59.          Index           =   5
  60.          Shortcut        =   ^X
  61.       End
  62.    End
  63.    Begin Menu mMain 
  64.       Caption         =   "&Window"
  65.       Index           =   1
  66.       Begin Menu mWin 
  67.          Caption         =   "&Cascade"
  68.          Index           =   0
  69.       End
  70.       Begin Menu mWin 
  71.          Caption         =   "Tile &Horizontally"
  72.          Index           =   1
  73.       End
  74.       Begin Menu mWin 
  75.          Caption         =   "Tile &Vertically"
  76.          Index           =   2
  77.       End
  78.       Begin Menu mWin 
  79.          Caption         =   "&Arrange Icons"
  80.          Index           =   3
  81.       End
  82.       Begin Menu mWin 
  83.          Caption         =   "-"
  84.          Index           =   4
  85.       End
  86.       Begin Menu mWin 
  87.          Caption         =   "Select &Window"
  88.          Index           =   5
  89.          WindowList      =   -1  'True
  90.       End
  91.    End
  92. End
  93. '---------------------------------------------------------------------------
  94. ' MDI Background Demo Program, Copyright (c) 1994 Karl E. Peterson
  95. ' Redistributed by permission.    CompuServe: 72302,3707
  96. ' See MDIDEMO.BAS for complete description
  97. '---------------------------------------------------------------------------
  98.  
  99. 'Default behavior
  100.   DefInt A-Z
  101.   Option Explicit
  102.  
  103. 'Index into File menu
  104.   Const mnfHide = 0
  105.   Const mnfUnload = 1
  106.   Const mnfShowAll = 3
  107.   Const mnfExit = 5
  108.  
  109. 'Index into Window menu
  110.   Const mnwCascade = 0
  111.   Const mnwHorizontal = 1
  112.   Const mnwVertical = 2
  113.   Const mnwArrange = 3
  114.  
  115. Sub Command1_Click ()
  116.   
  117.   mdiHide Me
  118.  
  119. End Sub
  120.  
  121. Sub Form_Load ()
  122.  
  123. End Sub
  124.  
  125. Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  126.   'Update status bar
  127.     DisplayStatus ""
  128. End Sub
  129.  
  130. Sub Form_Paint ()
  131.   
  132.   'Display something on the form
  133.     If WindowState <> MINIMIZED Then
  134.       Cls
  135.       CurrentX = (ScaleWidth - TextWidth(Caption)) \ 2
  136.       CurrentY = (ScaleHeight - TextHeight(Caption)) \ 2
  137.       Print Caption
  138.     End If
  139.  
  140. End Sub
  141.  
  142. Sub Form_Resize ()
  143.   'Paint something on the form
  144.     Refresh
  145. End Sub
  146.  
  147. Sub Form_Unload (Cancel As Integer)
  148.   'Set tracking element so this slot can be reused
  149.     fState(Val(Tag)) = frmDeleted
  150. End Sub
  151.  
  152. Sub mForm_Click (Index As Integer)
  153.   
  154.   'React to menu picks
  155.     Select Case Index
  156.       Case mnfHide: mdiHide Me
  157.       Case mnfUnload: Unload Me
  158.       Case mnfShowAll: mdiShowAll
  159.       Case mnfExit: Unload frmMain
  160.     End Select
  161.  
  162. End Sub
  163.  
  164. Sub mWin_Click (Index As Integer)
  165.   
  166.   'React to menu picks
  167.     Select Case Index
  168.       Case mnwCascade: mdiArrange WM_MDICASCADE
  169.       Case mnwHorizontal: mdiArrange MDITILE_HORIZONTAL
  170.       Case mnwVertical: mdiArrange MDITILE_VERTICAL
  171.       Case mnwArrange: mdiArrange WM_MDIICONARRANGE
  172.     End Select
  173.  
  174. End Sub
  175.  
  176.